package cn.itcast.consumer.controller;

import cn.itcast.consumer.client.UserClient;
import cn.itcast.consumer.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("consumer")
public class UserNewController {

    @Autowired
    private UserClient userClient;

    @GetMapping("user/{id}")
    public User queryUserById(@PathVariable("id")Long id){

        return userClient.queryUserById(id);
    }
}
